import { request } from "./request";
//手机号授权登录接口
export const login = (data) =>
  request({
    url: "/userAuthorization/userAuthorization/getWeChatAppletLogin",
    methods: "get",
    data,
  });

// 归属地-三级分类展示
export const gsdlist = () =>
  request({
    url: "/pointsmall/pointsPlace/list",
    methods: "get",
  });

// 保存归属地
export const saveWXAddrees = (data) =>
  request({
    url: "/userAuthorization/userAuthorization/saveWXAddrees",
    methods: "get",
    data,
  });

// 归属地-回显
export const showArea = (data) =>
  request({
    url: "/pointsmall/pointsPlace/showArea",
    methods: "get",
    data,
  });

// 归属地-修改归属地
export const editarea = (data) =>
  request({
    url: "/pointsmall/pointsPlace/editarea",
    methods: "get",
    data,
  });

// 活动预告列表
export const list = (data) =>
  request({
    url: "/pointsmall/pointsUpcomingEvents/list",
    methods: "get",
    data,
  });

  // 积分明细表-全部、支出、收入列表展示积分
export const allList = (data) => 
request({
  url: "/pointsmall/pointsIntegralDetails/intergralList",
  methods: "get",
  data,
})

// 积分明细表-收入积分列表
export const inList = (data) => 
request({
  url: "/pointsmall/pointsIntegralDetails/inList",
  methods: "get",
  data,
})

// 积分明细表 - 支出积分列表
export const outList = (data)=>
 request({
  url: "/pointsmall/pointsIntegralDetails/outList",
  methods: "get",
  data,
 })


// 积分明细表-积分汇总
export const total = () =>
request({
  url: "/pointsmall/pointsIntegral/total",
  methods: "post",
})

// 积分明细表-支出与收获积分汇总
export const inAndOutTotal = (data) => request({
  url:'/pointsmall/pointsIntegralDetails/inAndOutTotal',
  methods:'get',
  data
})

// 积分商场轮播图展示
export const carouselImageList = (data) => request({
  url:'/postPicture/postPicture/carouselImageList',
  methods:'get',
  data
})

// 公益活动列表
 export const Eventslist = (data) => request({
  url:'/pointsmall/pointsUpcomingEvents/list',
  methods:'get',
  data
 })

 // 活动预告列表-通过id 查询
 export const queryById = (data) => request({
   url:'/pointsmall/pointsUpcomingEvents/queryById',
   methods:'get',
   data
 })

 //活动报名
 export const  Personneladd = (data) => request({
  url:'/pointsmall/pointsActivityPersonnel/add',
  methods:'get',
  data
 })

 //判断是否已经报名
 export const isExistSignUp = (data) => request({
  url:'/pointsmall/pointsActivityPersonnel/isExistSignUp',
  methods:'get',
  data
 })

 // 积分规则表-查询
 export const pointsRuleslist= (data) => request({
  url:'/pointsmall/pointsRules/list1',
  methods:'get',
  data
 })

 // 活动预告表-集合广播列表
 export const broadcastList = () => request({
  url:'/pointsmall/pointsUpcomingEvents/broadcastList',
  methods:'get',
 })

 // 活动上报添加
 export const pointsActivityEscalationadd = (data) =>request({
  url:'/pointsmall/pointsActivityEscalation/add',
  methods:'post',
  data
 })

 // 商品分页列表-模糊查询
 export const fuzzyquery = (data) => request({
  url:'/pointsmall/pointsProductInformation/fuzzyquery',
  methods:'get',
  data
 })

//商品表-商品详情
export const ProductInformationdetail = (data) => request({
  url:'/pointsmall/pointsProductInformation/detail',
  methods:'get',
  data
})
// 商家信息
export const shopmessage = (data) => request({
  url:'/pointsmall/pointsmerchantapplication/shopmessage',
  methods:'get',
  data
})



//  商品兑换
export const exchange = (data) => request({
  url:'/pointsmall/pointsOrders/exchange',
  methods:'get',
  data
})

//订单表-当前-历史订单
export const selectOrder = (data) => request({
  url:'/pointsmall/pointsOrders/selectOrder',
  methods:'get',
  data
})

//核销码详情
export const showdata = (data) => request({
  url:'/pointsmall/pointsOrders/showdata',
  methods:'get',
  data
})

//历史最高荣誉
export const honor = (data,type) => request({
  url:`/pointsmall/pointsHonor/honor?id=${data}&type=${type}`,
  methods:'get'
})

// 历史最高等级
export const level = (data,type) => request({
  url:`/pointsmall/pointsHonor/level?id=${data}`,
  methods:'get',
})

//我的用户基础信息
export const  message = (data) => request({
  url:`/pointsmall/pointsHonor/message?id=${data}`,
  methods:'get',
}) 

// 关于我们
export const getAll = () => request({
  url:'/busagreement/busagreement/getAll',
  methods:'get',
})

// 商家申请表-添加
export const applicationadd = (data) => request({
  url:'/pointsmall/pointsmerchantapplication/add',
  methods:'post',
  data:data
})

// 商家申请表经营项
export const applicationitems = () => request({
  url:'/pointsmall/pointsmerchantapplication/items',
  methods:'get',
})

//商家申请表审核状态
export const applicationstatus = (data) => request({
  url:`/pointsmall/pointsmerchantapplication/status?id=${data}`,
  methods:'get',
})

//商家申请表-审核失败
export const pointsprocess = (data) => request({
  url:`/review/status`,
  methods:'post',
  data
})




// 商家申请表-审核失败后回显
export const applicationblack = (data) => request({
  url:`/pointsmall/pointsmerchantapplication/back`,
  methods:'post',
  data
})


////////////////////////////商家端接口///////////////////////////////////////

// 工作台
export const AndTodayToLast = () => request(
  {
    url:'/pointsmall/pointsOrders/yesterdayAndTodayToLast',
    methods:'get',
  }
)
// 工作台商家名称
export const selcetPicture = () => request({
  url:'/pointsmall/pointsmerchantapplication/selcetPicture',
  methods:'get',
})

// 通过核销码查找商品
export const byPscode  = (data) => request({
  url:'/pointsmall/pointsOrders/byPscode',
  methods:'get',
  data
}) 


//扫码核销
export const wxscan = (data) => request({
  url:'/pointsmall/pointsOrders/wxscan',
  methods:'get',
  data
})

//扫码详情
export const pointsOrders = (data) => request(
  {
    url:'/pointsmall/pointsOrders/showdata',
    methods:'get',
    data
  }
)

// 核销记录当月积分
export const currentMonthTotal = (data) =>request({
  url:'/pointsmall/pointsOrders/currentMonthTotal',
  methods:'get',
  data
})

// 核销记录
export const pointsOrderslist = (data) => request({
  url:'/pointsmall/pointsOrders/list',
  methods:'get',
  data
}) 


//财务上报
export const Reportingadd = (data) =>request({
  url:'/pointsmall/pointsFinancialReporting/add',
  methods:'post',
  data:data
})

//获取商家信息等级
export const applicationdetail = () => request({
  url:'/pointsmall/pointsmerchantapplication/detail',
  methods:'get',
})


//////////////////管理端////////////////////////////////////

//商家申请管理
  export const applicationdata = (data) =>request({
    url:'/pointsmall/pointsmerchantapplication/application',
    methods:'get',
    data
  })


//活动上报处理
export const applicationlist = (data) => request({
  url:'/pointsmall/pointsActivityEscalation/application',
  methods:'get',
  data
})

//我的审核和活动上报处理
export const wxlist = (data) => request({
  url:'/review/wx/list',
  methods:'get',
  data
})


//审核详情
export const wxinfolist = (data) => request({
  url:'/review/wx/list/info',
  methods:'get',
  data
})
//审核通过
export const approve = (data) => request({
  url:'/review/wx/review/approve',
  methods:'post',
  data
})

//审核驳回
export const overrule = (data) => request({
  url:'/review/wx/review/overrule',
  methods:'post',
  data
})



//具体申请中的活动详情
export const detailsActivities = (data) => request({
  url:'/pointsmall/pointsActivityEscalation/detailsActivities',
  methods:'get',
  data
})

//查找具体的商家
export const detailsSuper = (data) => request({
  url:'/pointsmall/pointsmerchantapplication/detailsSuper',
  methods:'get',
  data
})
//审核流程通过
export const datapasss = (data) => request({
  url:'/review/wx/review/approve',
  methods:'post',
  data
})
//审核流程驳回
export const noPass = (data) => request({
  url:'/review/wx/review/overrule',
  methods:'post',
  data
})

// 查询是否有权限审批数据 
export const isNoShowData = () => request({
  url:'/pointsprocess/pointsprocess/isNoShowData',
  methods:'get'
})


//归档列表接口
export const  documentationList = (data) => request({
  url:'/pointsprocess/pointsprocess/documentationList',
  methods:'get',
  data
})

//归档详情接口
export const documentationDetails = (data) => request({
  url:'/pointsprocess/pointsprocess/documentationDetails',
  methods:'get',
  data
})

// 发布活动
export const pointsadd = (data) => request(
  {
    url:'/pointsmall/pointsUpcomingEvents/add',
    methods:'post',
    data
  }
)

// 积分规则
export const  selectall = () => request(
  {
    url:'/pointsactivityrules/pointsactivityrules/selectall',
    methods:'post'
  }
)

//活动管理
export  const allpageList = (data) => request({
  url:'/pointsmall/pointsActivityPersonnel/allpageList',
  methods:'get',
  data
})

// 活动报名模糊查询
export const findpersion = (data) => request({
  url:'/pointsmall/pointsActivityPersonnel/findpersion',
  methods:'get',
  data
})

//活动管理报名人员数据维护
export const updatedata = (data) => request({
  url:'/pointsmall/pointsActivityPersonnel/updatedata',
  methods:'get',
  data
})

//积分规则添加
export const rulesadd = (data) => request(
  {
    url:'/pointsactivityrules/pointsactivityrules/add',
    methods:'post',
    data
  }
)

// 积分规则编辑
export const rulesedit = (data) => request({
  url:'/pointsactivityrules/pointsactivityrules/edit',
  methods:'post',
  data
})

//积分规则删除
export const deleterule = (data) => request({
  url:`/pointsactivityrules/pointsactivityrules/delete?id=${data.id}`,
  methods:'delete'
})

// 积分规则列表
export const  rulesselectall = (data) => request({
  url:'/pointsactivityrules/pointsactivityrules/findall',
  methods:'get',
  data
})

//小喇叭通知列表
export const pushTemplatelist = (data) => request({
  url:'/pointsmall/pointsPromptInformation/broadcast',
  methods:'get',
  data
})

//小喇叭通知信息
export const carousel = (data) => request({
  url:'/pointsmall/pointsPromptInformation/carousel',
  methods:'get',
  data
})

//删除详细消息接口
export const deletedata = (data) => request({
  url:`/pointsmall/pointsPromptInformation/delete?id=${data.id}`,
  methods:'delete'
})


// 判定该商家是否已经审批/wx/review/power
export const power = (data) => request({
  url:'/review/wx/review/power',
  methods:'get',
  data
})

//商家详情接口 /review/perstatus
export const powertatus = (data) => request({
  url:`/review/perstatus?id=${data}`,
  methods:'post',
})


//控制冻结商家不能登录和核销积分 get  /userAuthorization/userAuthorization/isFrozen
export const isFrozen = (data) => request({
  url:'/userAuthorization/userAuthorization/isFrozen',
  methods:'get',
  data
})


//扫码获取商品   /pointsmall/pointsOrders/findPscode
export const findPscode = (data) => request({
  url:'/pointsmall/pointsOrders/findPscode',
  methods:'get',
  data
})

//首页-商家接口  /pointsmall/pointsmerchantapplication/shopList
export const   shopList = (data) => request({
  url:'/pointsmall/pointsmerchantapplication/shopList',
  methods:'get',
  data
})

// 店铺分类接口   /pointsmall/pointsProductInformation/productCategorize
export const  productCategorize = (data) =>  request({
  url:'/pointsmall/pointsProductInformation/productCategorize',
  methods:'get',
  data
})

// 店铺查询商品  /pointsmall/pointsProductInformation/findCommodity
export const findCommodity = (data) => request({
  url:'/pointsmall/pointsProductInformation/findCommodity',
  methods:'get',
  data
})


// 反馈建议上报接口  /pointsFeedBack/pointsFeedBack/add
export const pointsFeedBackadd = (data) => request({
  url:`/pointsFeedBack/pointsFeedBack/add?remark=${data.remark}`,
  methods:'post'
})